<%-- //@ include file="../include/eproAuthorization.jsp" --%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<%@ page  
                    errorPage="../eproErrorPage.jsp"
                    import="java.util.Vector,java.util.HashMap,
                                   java.text.*,java.util.*,
                                   com.epro.standard.frontend.util.ShowData,
                                   com.epro.standard.frontend.util.EproServletUtil,
                                   com.epro.standard.frontend.util.FileInfoUtil,
                                   com.softplus.carrefour.hd.CFHDSystem,
                                   com.softplus.carrefour.hd.bltier.admin.TimeZoneManage,
                                   com.softplus.carrefour.hd.bltier.entity.Timezone,
                                   com.softplus.carrefour.hd.bltier.admin.CountryManage,
                                   com.softplus.carrefour.hd.bltier.entity.Country"
%>
<HTML xmlns:epro>
<%@ taglib uri="/WEB-INF/DynamicMasterTag.tld" prefix="dynamicmaster"%>
<%@ taglib uri="/WEB-INF/ViewTableTag.tld" prefix="view"%>
<%@ taglib uri="/WEB-INF/HeadTag.tld" prefix="head"%>
<%@ taglib uri="/WEB-INF/MasterTag.tld" prefix="master"%>
<%@ taglib uri="/WEB-INF/ToolbarTag.tld" prefix="toolbar"%>
<%@ taglib uri="/WEB-INF/NavigateBarTag.tld" prefix="navigate"%>
<%@ taglib uri="/WEB-INF/HintTag.tld" prefix="hint"%>
<%@ taglib uri="/WEB-INF/ErrorTag.tld" prefix="error"%>
<%@ taglib uri="/WEB-INF/TextfieldTag.tld" prefix="textfield"%>
<%@ taglib uri="/WEB-INF/CheckboxTag.tld" prefix="checkbox"%>
<%@ taglib uri="/WEB-INF/LovButtonTag.tld" prefix="lovbutton"%>
<%@ taglib uri="/WEB-INF/ListboxTag.tld" prefix="listbox"%>
<head:Head
	author		="MAX"
	title			="Time Zone Setup"
	import		="masterTable,toolbar,navigateBar,hint,error,viewtable,textfield,button,listbox"
	styleFile	="../theme/defaultTheme.css"
	jsFile		="../script/spTitleRefresh.js,../script/imgProp.js,../script/Alert.js,../script/showHints.js,../script/lov.js,../script/masterTable.js,../script/MasterTableManager.js,../script/multiRecLovControl.js" />
<%@ include file="../include/toolbarHint.jsp" %>
<%
	//errorPage="../include/eproErrorPage.jsp"

// define variable **************************
	FileInfoUtil	fileInfoUtil 			= session.getAttribute("fileInfoUtil")!=null?(FileInfoUtil)session.getAttribute("fileInfoUtil"):new FileInfoUtil() ;
            fileInfoUtil.setMenuIDCode("CFHDADMT02 ");
            fileInfoUtil.setMenuName("Time Zone Setup");
            fileInfoUtil.setMenuDesc("To setup time zone");
            fileInfoUtil.setMasterWording("Time Zone");
//	UserAccountVO userLogin					= (UserAccountVO)session.getAttribute("userLogin");
//	String menuIDCode					      = fileInfoUtil.getMenuIDCode();
	ShowData            showData 	= new ShowData();

	EproServletUtil	servletUtil		= new EproServletUtil(request) ;
	
// define variable for MasterTag *********
  String userID               = showData.CheckNull(request.getParameter("uid")) ;
  if(userID != "")
    session.setAttribute("userIDADMT02", userID) ;
	String linkParameter			= "?" ;
	String noUpdate					= "true";
	String noDetail					= "true";
	String detailWidth 				= "40";
	String detailHeight 				= "20";
	
	String queryURL						  = "CFHDADMT02.jsp?uid=" + userID; // fileInfoUtil.getMasterURL()+linkParameter;
	String queryOnclick					= "window.location.href('" + queryURL +"')";
	String backURL						  = "/CFRL/CFRLWEBMN01.jsp" ; //request.getContextPath() + "/CFRLWEBMN01.jsp?page=1" ;
//	String backClick						= fileInfoUtil.getHasParent()+"parent.window.location.href('" + backURL +linkParameter+"')";
	String backClick						= "window.location='" + backURL + "'" ; //"parent.window.location.href('" + backURL +linkParameter+"')";
	String canSort					    =  "false";
	
	
// *********************************************
// variable for master table need	*********	
	String[] 	head   					 = {"Country Name","Different Hour","Update By","Update Date",""} ;
  String[]  itemName                    = {"COUNTRY_NAME","DIFF_HOUR","UPD_BY","UPD_DATE","COUNTRY_ID"} ;
	String[]	dataType				 = {"display","display","display","display","code"} ;
	String 	maxDataLength 	 = "100,10,20,10,10";
	String[] 	dataWidth 			      = {"300","100","120","110","0"};// ????????? =  (masterWidth+50)
	String 	masterWidth 			 = "740";
	String	masterHeight 		 = "250";
			
// variable for sortData *********************
	int		 		sortBy 				= request.getParameter("sortBy")==null ? 0 : Integer.parseInt(request.getParameter("sortBy")) ;
	boolean 	isAsc					= request.getParameter("isAsc") == null ? true : Boolean.valueOf(request.getParameter("isAsc")).booleanValue() ;

// default page
	int Page =  1;
		
// create manager
  TimeZoneManage tm = (TimeZoneManage)CFHDSystem.getControlClass("TIME_ZONE") ;
	
//********************** calculate number of page ************************
  Vector dataVector = tm.getAllTimeZone() ;
  session.setAttribute("TimeZoneVector", dataVector);
  int allSize = dataVector.size() ;
// max record of page	
	int MAXRECORD = dataVector.size() ; 
//	data size default
	int vectorSize= dataVector.size() ;

// prepare data
		String[][] data = new String[head.length][vectorSize];
// ***************** MAX standard - multi record *****************B
		String[] column 				= new String[head.length];
		String[] item 					= new String[head.length];// type form
		String[] record 				= new String[vectorSize];//data
		String notNullColumn 	  = "false,false,false,false,false" ;//insert
		String actionPath 			= "../servlet/com.softplus.carrefour.hd.frontend.servlet.administration.CFHDAD02"+linkParameter ;
		String sortColumn 			= request.getParameter("sortBy") ;
		String sortDirection 		= request.getParameter("isAsc") ;
		String hasScroll 			  = "true" ;
		
		
	///----------------------------------------------------------------------------
	String transMode    = showData.CheckNull(request.getParameter("transMode"));
	String countryID    = servletUtil.getRequestValue("countryID")==null?"":servletUtil.getRequestValue("countryID") ;
  String countryName  = servletUtil.getRequestValue("countryName")==null?"":servletUtil.getRequestValue("countryName") ;
	if(!countryID.equals("")) transMode = "insert"; 

  //------------------------Assign column description ---------------------------	
    column[0] = "'id=" + itemName[0] + ", label=" + head[0] + ", width=" + dataWidth[0] + "'" ;
    column[1] = "'id=" + itemName[1] + ", label=" + head[1] + ", width=" + dataWidth[1] + "'" ;
    column[2] = "'id=" + itemName[2] + ", label=" + head[2] + ", width=" + dataWidth[2] + "'" ;
    column[3] = "'id=" + itemName[3] + ", label=" + head[3] + ", width=" + dataWidth[3] + "'" ;
    column[4] = "'id=" + itemName[4] + ", label=" + head[4] + ", width=" + dataWidth[4] + "'" ;
    
  //------------------------Assign item for master-------------------------------
    item[0]   = "'<INPUT TYPE=\"text\" NAME=\"" + itemName[0] + "\" style=\"width :" + dataWidth[0] + "\">'" ;
    
    if (transMode.equalsIgnoreCase("normal")||transMode.equals("")){
      item[1]   = "'<INPUT TYPE=\"text\" NAME=\"" + itemName[1] + "\" style=\"width :" + dataWidth[1] + ";text-align:right;\">'" ;
    }else{
      dataType[1] = "select" ;
      String hourDiff = "'<select name=\"" + itemName[1] + "\" style=\"width :50; text-align:right\">" ;
      for (int i=13; i>-13; i--)
      {
        String timeSign = (i>0)?"+":"" ;
        hourDiff += "<option value=\"" + showData.CheckNull(timeSign+i) + "\">" + showData.CheckNull(timeSign+i) + "</option>" ;
      }
      hourDiff  += "</select>'" ;
      item[1]   = hourDiff ;
    }
    
//    if (transMode.equalsIgnoreCase("update")){
//      dataType[2] = "list" ;
//      item[2] = "'<select name=\"" + itemName[2] + "\" style=\"width :" + dataWidth[2] + "\"><option value=\"Y\">Active</option><option value=\"N\">Inactive</option></select>'" ;
//    }else{
//      item[2] = "'<INPUT TYPE=\"text\" NAME=\"" + itemName[2] + "\" style=\"width :" + dataWidth[2] + "\">'" ;
//    }
    
    item[2]   = "'<INPUT TYPE=\"text\" NAME=\"" + itemName[2] + "\" style=\"width :" + dataWidth[2] + "\">'" ;
    item[3]   = "'<INPUT TYPE=\"text\" NAME=\"" + itemName[3] + "\" style=\"width :" + dataWidth[3] + ";text-align:center\">'" ;
    item[4]   = "'<INPUT TYPE=\"hidden\" NAME=\"" + itemName[4] + "\" style=\"width :" + dataWidth[4] + ";height:0;display:none;\">'" ;
    
  // ====================== insert mode ============================== //
  Date  d = new Date() ;
  String hasData  = "true" ;
  String isNewCountry       = "false" ;
  String originCountryID    = "" ;
  String originCountryName  = "" ;
  String allCountryID       = "" ;
  String allCountryName     = "" ;
  String originalCountryID  = "" ;
  String[] listID   = {} ;
  String[] listName = {} ;
  boolean isPageComplete = true ;
	if (transMode.equals("insert"))
  {
      originalCountryID = tm.getOrigin().getCountryId() ;
      originCountryID   = request.getParameter("originID") ;
      originCountryName = tm.getTimeZoneByCountry(originCountryID).getCountry().getCountryName() ;
			dataVector = new Vector() ;
			if(!countryID.equals(""))
			{		
					String delimeter=",";
					java.util.StringTokenizer stCountryID 	= new java.util.StringTokenizer(countryID,delimeter) ;
          java.util.StringTokenizer stCountryName	= new java.util.StringTokenizer(countryName,delimeter) ;
          while(stCountryID.hasMoreTokens())
          {
            String	tmpCountryID    = stCountryID.nextToken() ;
            String  tempCountryName = stCountryName.nextToken() ;
            dataVector.addElement("'"+tempCountryName+"','+13','" + userID + "','" + showData.CheckNull(d,"dd/MM/yyyy") + "','"+tmpCountryID+"'") ;
          }//end of while
			}//end of if
			vectorSize  = dataVector.size() ;
			MAXRECORD   = vectorSize ;
			record      = new String[vectorSize] ;
			for ( int i = 0 ; i < vectorSize ; i++ )
			{
					record[i] = (String)dataVector.elementAt(i) ;
			}
	} else {		// to show data table 
      if((vectorSize == 0) || transMode.equals("update"))
      {
        if (vectorSize == 0)
        {
          hasData = "false" ;
          allCountryID    = "''," ;
          allCountryName  = "'Select Origin Country'," ;
          originCountryID = showData.CheckNull(request.getParameter("originCountryList")) ;
        }
        CountryManage cm  = (CountryManage)CFHDSystem.getControlClass("COUNTRY") ;
        Vector cv         = cm.getAllCountry() ;
        for(int cc=0; cc<cv.size(); cc++)
        {
          allCountryID    += "'" + ((Country)cv.elementAt(cc)).getCountryId() + "'," ;
          allCountryName  += "'" + ((Country)cv.elementAt(cc)).getCountryName() + "'," ;
        }
        allCountryID    = allCountryID.substring(0,allCountryID.length()-1) ;
        allCountryName  = allCountryName.substring(0,allCountryName.length()-1) ;
      }

      String originCountryList = showData.CheckNull(request.getParameter("originCountryList")) ;
      Vector tmv = new Vector() ;
      
      if(vectorSize > 0)
      {
        if(request.getParameter("originCountryList")==null)
        {
          Timezone  te1      = new Timezone() ;
          te1    = tm.getOrigin() ;
          tmv = tm.getNotCountryTimeZone(te1.getCountryId()) ;
          originCountryID   = te1.getCountryId() ;
          originCountryName = te1.getCountry().getCountryName() ;
          originalCountryID = te1.getCountryId() ;
        }
        else
        {
          tmv    = tm.getNotCountryTimeZone(showData.CheckNull(request.getParameter("originCountryList"))) ;
          Timezone te   = new Timezone() ;
          te      = tm.getTimeZoneByCountry(showData.CheckNull(request.getParameter("originCountryList"))) ;
          if (te != null)
          {
            originCountryID   = te.getCountryId() ;
            originCountryName = te.getCountry().getCountryName() ;
            originalCountryID = tm.getOrigin().getCountryId() ;
          }
          else
          {
            originCountryID   = showData.CheckNull(request.getParameter("originCountryList")) ;
            originalCountryID = tm.getOrigin().getCountryId() ;
            isNewCountry      = "true" ;
          }
        }
        record = new String[tmv.size()] ;
        MAXRECORD         = tmv.size() ;
        vectorSize        = tmv.size() ;
      }

try {      
      System.out.println("=================== vector size === : " + tmv.size()) ;
      for(int i=0;i<tmv.size();i++)
      {
        Timezone tEntity = new Timezone() ;
        tEntity     = (Timezone)tmv.elementAt(i);
        record[i] = "'" + showData.CheckNull(tEntity.getCountry().getCountryName()) + "'," ;
        int    timeShift  = Integer.parseInt(tEntity.getTimeShift().toString()) ;
        String timeSign   = (timeShift>0)?"+":"" ;
        timeSign          = timeSign + showData.CheckNull(timeShift) ;
        record[i] += "'" + timeSign + "'," ;
        record[i] += "'" + tEntity.getUpdBy() + "'," ;
        record[i] += "'" + showData.CheckNull(tEntity.getUpdDate(),"dd/MM/yyyy") + "'," ;
        record[i] += "'" + showData.CheckNull(tEntity.getCountryId()) + "'" ;
      }
} catch (NullPointerException e) {
    isPageComplete = false ;
  %>
    <script type="text/javascript">
      location.reload() ;
    </script>
  <%
}
      
	}
// ***************** MAX standard - multi record *****************N
%>
<script type="text/javascript">
//--------------------------------------------------------------------------------------
//check multiple Lov selection
 	function checkMultipleLov(frmName , inputObj, inputObj2)
  {
		if(inputObj.value!="")
		{
      inputObj.value = getDataSelect('<%=transMode%>','<%=itemName[4]%>') + "," + inputObj.value;		//alert(inputObj.value) ;
		}
    if(inputObj2.value!="")
    {
      inputObj2.value = getDataSelect('<%=transMode%>','<%=itemName[0]%>') + "," + inputObj2.value;		//alert(inputObj.value) ;
    }
    if((inputObj.value!="") && (inputObj2.value!=""))
    {
      frmName.submit();
    }
	}
 
	function clickSave()
	{		
    if(showOConfirmDialog("Save Data", "Save Data ?", "OK", "Cancel") == 1)
		{
      if (!(<%=hasData%>))
      {
        setOriginFrm.action = '<%=actionPath%>&setOrigin=y' ;
        setOriginFrm.submit() ;
      }
      else
      {
        submitTransaction('<%=transMode%>');
      }
    }
	}
  
	function clickDelete()
	{
	  if(showOConfirmDialog("Delete Data", "Delete Data ?", "OK", "Cancel") == 1)
		{
			deleteMode("<%=transMode%>") ;
		}
	}
  
  function queryData()
  {
    if (<%=vectorSize%> > 0 )
    {  
			if (chkHasChange())
      {
				if (showOConfirmDialog('Save Data', 'Do you want to save the changes?', 'OK', 'Cancel') == 1)
        {
          if (!(<%=hasData%>))
          {
            setOriginFrm.action = '<%=actionPath%>&setOrigin=y' ;
            setOriginFrm.submit() ;
          }
          else
          {
            submitTransaction('<%=transMode%>');
          }
        }
			 	else
				 	window.location.href ="<%= queryURL%>" ;
		 	}	else
	 		  window.location.href ="<%= queryURL%>" ;
    } else
      window.location.href ="<%= queryURL%>"+"&page="+getPage;
  }
 
  function backTomenu()
  {
    showProgramLayer();
    if (<%=vectorSize%> > 0 )
    {  
          if (chkHasChange())
           {
				if (showOConfirmDialog('Save Data', 'Do you want to save the changes?', 'OK', 'Cancel') == 1)
                    {
                              if (!(<%=hasData%>))
                              {
                                setOriginFrm.action = '<%=actionPath%>&setOrigin=y' ;
                                setOriginFrm.submit() ;
                              }
                              else
                              {
                                submitTransaction('<%=transMode%>');
                              }
                    }
			 	else{
                       //alert('1 ');
				 	<%=backClick%> ;
                    }
		 	}else{
               //alert('2');
	 		  <%=backClick%> ;
               }
    } else{
    //alert('3');
      <%=backClick%> ;
     }
  }
//  function backTomenu()
//  {
//		if (<%=vectorSize%> > 0)
//		{
//      if (chkHasChange())
//			{		
//        if ('<%=transMode%>'=='update')
//        {
//          if (showOConfirmDialog('Save Data', 'Do you want to save the changes?', 'OK', 'Cancel') == 1)
//          {
//            if (!(<%=hasData%>))
//            {
//              setOriginFrm.action = '<%=actionPath%>&setOrigin=y' ;
//              setOriginFrm.submit() ;
//            }
//            else
//            {
//              submitTransaction('<%=transMode%>');
//            }
//          }
//					else
//            <%=backClick%> ;
//        }
//      }
//      else
//				<%=backClick%> ;
//		}
//		else
//      <%=backClick%> ;
//  }
  
	function tabLOV(keyword) {
    var arr = getDataSelect('insert','<%=itemName[4]%>').split(',') ;
    selectedID = "" ;
    for(i=0; i<arr.length-1; i++)
      selectedID += ",'" + arr[i] + "'" ;
    selectedID += ",'" + setOriginFrm.originCountryID.value + "'"
		showLov('../CFHDLOV/CFHDADLV02.jsp?isMultiple=true&selectedID='+selectedID.substring(1),'addCountry.countryID|addCountry.countryName','', '') ;
	}
  
  function chengeOrigin()
  {
    if ((setOriginFrm.originCountryList.value != '')&&(<%=hasData%>))
      setOriginFrm.submit() ;
  }
  
  function setOriginList()
  {
    if (!(<%=hasData%>) || ('<%=transMode.toLowerCase()%>'=='update'))
    {
      setOriginFrm.originCountryName.style.display = 'none' ;
      setOriginFrm.originCountryList.style.width   = 280 ;
      originCountryID = '<%=originCountryID%>' ;
      selectIndex     = 0 ;
      var arrID   = new Array(<%=allCountryID%>) ;
      var arrName = new Array(<%=allCountryName%>) ;
      for(i in arrID)
      {
        var oOption = document.createElement("OPTION");
        setOriginFrm.originCountryList.options.add(oOption);
        oOption.value     = arrID[i] ;
        oOption.innerText = arrName[i] ;
        if(arrID[i] == originCountryID)
        {
          selectIndex = i ;
        }
      }
      setOriginFrm.originCountryList.options[selectIndex].selected = true ;
    }
    else
    {
      setOriginFrm.originCountryList.style.display = 'none' ;
    }
  }
  
  function submitTransaction(transMode) {
		var masterForm = document.eproMasterForm ;
		var path = self.window.location.href.split('transMode=') ;
		if ((path.length > 1) && (path[1].substring(0,6) == 'update'))
		{
			for ( i = 0 ; i < recordPerPage ; i++ )
			{
				var rowObj = document.getElementById('dataID' + i) ;
				var strCheck = "" ;
				
			for( j = 1 ; j < rowObj.children.length ; j++ )
			{	
				if (rowObj.children[j].children[0].outerHTML.toUpperCase().indexOf('TYPE=RADIO') == -1)
				//++BEGIN++++++++++ for update on checkbox object ++++++++++udong++//
				{	if (rowObj.children[j].children[0].outerHTML.toUpperCase().indexOf('TYPE=CHECKBOX') == -1)
					{
						if (trim(rowObj.children[j].children[0].value+'alebaba') != 'alebaba')
							strCheck += trim(rowObj.children[j].children[0].value) ;
					}
					else 
					{
						if (rowObj.children[j].children[0].checked)
							strCheck += trim(rowObj.children[j].children[0].value) ;
						else
							strCheck +="N";
					}					
				}
				//++ENDING++++++++++ for update on checkbox object ++++++++++udong++//
				else
					for (k = 0 ; k < rowObj.children[j].children.length ; k++)
					{
						if (rowObj.children[j].children[k].outerHTML.toUpperCase().indexOf('TYPE=RADIO') != -1)
						{
							if (rowObj.children[j].children[k].checked)
							{
								strCheck += rowObj.children[j].children[k].value ;
								break ;
							}
						}
					}
			} // end inner for
				if (masterTable.strCheck.indexOf(strCheck) == -1)
					rowObj.children[0].children[1].value = 'U' ;
				else
					rowObj.children[0].children[1].value = 'N' ;
			}
		}
    
    var strPath = masterTable.actionPath.split('?') ;
		masterForm.method = 'post' ;
    
    if (strPath.length > 1)
			masterForm.action = masterTable.actionPath + '&MAXRECORD=' + masterTable.maxRecordPerPage + '&page=' + currentPage ;
		else
			masterForm.action = masterTable.actionPath + '?MAXRECORD=' + masterTable.maxRecordPerPage + '&page=' + currentPage ;
    
    if(setOriginFrm.originCountryID.value != setOriginFrm.originCountryList.value)
      masterForm.action = masterForm.action + '&originCountryID=' + setOriginFrm.originCountryList.value ;
    if('<%=isNewCountry%>' == 'true')
      masterForm.action = masterForm.action + '&isNewCountry=y' ;
    changeTransStatus(transMode) ;
    for(i = 0 ; i < masterForm.length ; i++)
    {
      var item = masterForm.elements[i] ;
      item.disabled = false ;
    }
    masterForm.submit() ;
  }

  function hasSelectToDel()
	{
		var hasSelect = false ;
		for (i = 0 ; i < recordPerPage ; i++)
		{
			var rowObj = document.getElementById('dataID' + i) ;
			if (rowObj != null)
				if (rowObj.children[0].children[2] != null)
					if (rowObj.children[0].children[2].checked == true)
					{
						hasSelect = true ;
						break ;
					}
		}
		return hasSelect ;
	}

        function showProgramLayer(){
                document.all.programLayer.style.visibility='hidden';
                document.all.processingLayer.style.visibility='visible';
        }
</script>
<body style="padding-left:10px;" onload="setOriginList();" onfocus="checkMultipleLov(addCountry,addCountry.countryID,addCountry.countryName);">
 <div id="processingLayer" style="visibility:hidden; position:absolute; left:100px; top:150px;">
	<IMG alt="Waiting..." SRC="../images/background/Processing.gif" WIDTH="585" HEIGHT="136" BORDER="0">
</div>
<div style="width:90%;height:90%;margin:5px"  id="programLayer">
<form name="addCountry" action="" method="post">
    <input name="transMode" type="hidden" value="insert">
     <input name="countryID" type="hidden">
     <input name="countryName" type="hidden">
     <input name="originID" type="hidden" value="<%=originalCountryID%>">
	</form>
  <%=fileInfoUtil.MasterHeadTable()%>
				<table style="margin-left:10px;" width="100%" align="center" border="0" cellpadding="0" cellspacing="0"> 
					<tr>
						<td class="borderFontColor" align="center">		<!-- TOOL BAR -->
                         
                       <form name="setOriginFrm" method="post" action="">
                          <table border="0" cellpadding="0" cellspacing="2" align="left">
                          <tr><td rowspan="3" width="200" >&nbsp;</td></tr>
                            <tr class="borderFontColor">
                              <td nowrap="nowrap" align="right">Origin Country : </td>
                              <td align="left">
                                <listbox:listbox name="originCountryList" width="0" data="<%=listName%>" label="<%=listID%>" onchange="chengeOrigin();"/>
                                <textfield:textfield name="originCountryName" width="280" value="<%=originCountryName%>" styleClass="disabledTxtField" readonly="true"/>
                              </td>
                            <tr class="borderFontColor">
                              <td nowrap="nowrap" align="right">Different Hour(s) : </td>
                              <td align="left"><textfield:textfield name="diffHour" width="280" value="0" styleClass="disabledTxtField" styleS="text-align:right" readonly="true"/></td>
                            </tr>
                          </table>
                          <input type="hidden" name="originCountryID" value="<%=originalCountryID%>">
                        </form>
                 
						</td>
					</tr>
          <tr>
            <td class="borderFontColor">
            <span style="width:200pt;">&nbsp;</span>
                <img alt="<%=backHint%>" src="../images/icon/toolbar/nBackToMenu.gif" onmouseover="this.src='../images/icon/toolbar/oBackToMenu.gif'" onmouseout="this.src='../images/icon/toolbar/nBackToMenu.gif'" style="cursor:hand" onclick="backTomenu();">
                <img alt="<%=queryHint%>" src="../images/icon/toolbar/nQuery.gif" onmouseover="this.src='../images/icon/toolbar/oQuery.gif'" onmouseout="this.src='../images/icon/toolbar/nQuery.gif'" style="cursor:hand" onclick="queryData();">
                <%  if(!(transMode.equalsIgnoreCase("update"))) {%>
                <img alt="<%=insertHint%>" src="../images/icon/toolbar/nAdd.gif" onmouseover="this.src='../images/icon/toolbar/oAdd.gif'" onmouseout="this.src='../images/icon/toolbar/nAdd.gif'" style="cursor:hand" onclick="tabLOV(addCountry.countryID);">
                <% } %>
    						<%  if(allSize>0&&(!transMode.equalsIgnoreCase("update"))) {%>
                  <img alt="<%=deleteHint%>" src="../images/icon/toolbar/nDelete.gif" onmouseover="this.src='../images/icon/toolbar/oDelete.gif'" onmouseout="this.src='../images/icon/toolbar/nDelete.gif'" style="cursor:hand" onclick="clickDelete();">
        				<% } %>
    						<%  if((allSize > 0)&&!(transMode.equalsIgnoreCase("insert"))&&!(transMode.equalsIgnoreCase("update"))) {%>
                  <img alt="<%=editHint%>" style="cursor:hand" src="../images/icon/toolbar/nEdit.gif" onmouseover="this.src='../images/icon/toolbar/oEdit.gif' " onmouseout="this.src='../images/icon/toolbar/nEdit.gif' " onclick="editMode();"/>
        				<% } %>
                <% if(transMode.equalsIgnoreCase("insert")||transMode.equalsIgnoreCase("update")||allSize==0) {%>
                  <img alt="<%=saveHint%>" src="../images/icon/toolbar/nSave.gif" onmouseover="this.src='../images/icon/toolbar/oSave.gif'" onmouseout="this.src='../images/icon/toolbar/nSave.gif'" style="cursor:hand" onclick="clickSave();">
                <% } %>
								<%=fileInfoUtil.MasterWording()%>
            </td>
          </tr>
					<tr>
						<td height="<%=masterHeight%>" valign="top" >		<!-- MASTER DATA -->
							<% if(vectorSize > 0) {%>
									<hint:hint id="hint1"></hint:hint>
									<dynamicmaster:dynamicmaster
											column="<%=column%>"
											item="<%=item%>"
											dataType="<%=dataType%>"
											record="<%=record%>"
											currentpage="<%=Page%>"
											maxrecord="<%=MAXRECORD%>"
											notNullColumn="<%=notNullColumn%>"
											transMode="<%=transMode%>"
											actionPath="<%=actionPath%>"
											sortColumn="<%=sortColumn%>"
											sortDirection="<%=sortDirection%>"
											hasScroll="<%=hasScroll%>"
											masterHeight="<%=masterHeight%>"
											masterWidth="<%=masterWidth%>"
											maxDataLength="<%=maxDataLength%>"
											canSort="<%=canSort%>"
                                                       canDelete="true"
											></dynamicmaster:dynamicmaster>
							<%	}else{
//                    if(!roleID.equals("")){
//                      out.println(fileInfoUtil.DataNotFoundMessage());
//								  	}
                  }%>
							<script type="text/javascript">
									changeTransStatus('<%=transMode%>') ;
							</script>
						</td>
					</tr>
					<tr>
						<td>		<!-- NAVIGATE BAR -->
								<%//@ include file="../include/eproNavigateTag.jsp"%>
						</td>
					</tr>
				</table>
 <%=fileInfoUtil.MasterFootTable()%>
</div>
<%//}%>
</body>
<!--textarea name="masterSrc" style="width:700;height:400;"></textarea>
<SCRIPT>
	document.all.masterSrc.value = document.all.eproMasterForm.innerHTML ;
</SCRIPT-->
</html>
<% if (isPageComplete) {%>
<%@ include file="../include/eproErrorAlert.jsp"%>
<%  } %>
